package com.ryan.time.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.net.Uri;

public class DbHelper extends SQLiteOpenHelper{

	public DbHelper(Context context) {
		super(context, "sbnote", null, 1);
	}

	public static class Time{
		public static final Uri CONTENT_URI = Uri.parse("content://com.ryan.time.provider/time");
		public static final String ID="_id";
		public static final String TITLE="title";
		public static final String COND="cond";
		public static final String ACTION="action";
		public static final String TIME="time";
		public static final String RESULT="result";
		public static final String CREATE="create_time";
	}
	
	String tableTime = "CREATE TABLE IF NOT EXISTS time(" +
			"_id INTEGER PRIMARY KEY," +
			"title TEXT," +
			"cond INTEGER," +
			"action INTEGER," +
			"time INTEGER," +
			"result INTEGER," +
			"create_time INTEGER);";
	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(tableTime);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		onCreate(db);
	}

}
